package org.cornland.systemWarning.service.impl;

import org.cornland.systemWarning.model.Terrace;
import org.cornland.systemWarning.mapper.TerraceMapper;
import org.cornland.systemWarning.service.TerraceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Hawk Tang
 * @since 2021-10-13
*/


@Service
@Slf4j
public class TerraceServiceImpl extends ServiceImpl<TerraceMapper, Terrace> implements TerraceService {

   @Autowired
   private TerraceMapper terraceMapper;

   public Terrace selectByPrimaryKey(Integer id){
        Terrace terrace = terraceMapper.selectById(id);
        return terrace;
   }

   public List<Terrace> selectAll(){
        List<Terrace> terraceList = terraceMapper.selectList(null);
        return terraceList;
   }

   public Integer insert(Terrace terrace){
        int result = terraceMapper.insert(terrace);
        return result;
   }

   public Integer updateByPrimaryKey(Terrace terrace){
        int result = terraceMapper.updateById(terrace);
        return result;
   }

   public Integer deleteByPrimaryKey(Integer id){
        int result = terraceMapper.deleteById(id);
        return result;
   }







}